<? 
require('includes/class.main.php');
$manager = new MeetingManager();
include('template/header.php');
$lookup = new CalendarLookup();
$titles = $lookup->getTitles();
$events = $lookup->getEvents();
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <?php MeetingManager::echoMetaData(); ?>
</head>  	
<body>
 	<div class="content">
  	
  	<?php include_once 'template/menu.php'; ?>
	<div class="subheader">
	</div>
  	
  	<div class="center">

	<div class="left">
	<div class="blurb">
		<span class="blue"><b>Summary of Events </b></span>
		<br>

		<?
		while ($title = $titles->fetch_row()) {
			echo "<a href=#event_".$title[0].">".$title[1]."</a> - ";
			echo substr($title[2], 0, 3) ." $title[3] <br>";
		}
		?>
	</div>

	<div class="blurb">
		The events listed here are presented solely as a service to visitors
		to our website, <b>not as an endorsement</b> by the Atlanta Intergroup
		Central Office.
	</div>

	<div class="blurb">To have your A.A. event posted on our calendar,
		please notify the Atlanta Central Office at least one month prior to
		your event.</div>
</div>

<div class="right">
	<h1>
		<span class="blue">Atlanta Calendar of Events</span>
	</h1>
	<br>

	<?
	while ($event = $events->fetch_row()) {
		echo "<a name=event_".$event[0]."></a>";
		echo "<u>$event[3], $event[4] $event[5], $event[6] $event[2]</u> <br>";
		echo "<b>$event[1]</b><br>";

		for ( $counter = 7; $counter <= 16; $counter++) {
	  if ($event[$counter] != "") {
	  	print $event[$counter]."<br>\n";
	  }
		}

		print "<br>\n";
	}
	?>

</div>

<? include('template/footer.php'); ?>
</div>
</div>
</body>
</html>